
var express = require('express');
var router = express.Router();
var sql = require('../sql.js');
router.use('/', function(req, res) {
  /*res.send('1');*/ 
    var id=req.cookies.id
    var NewUrl=req.cookies.photo
    console.log(NewUrl)
  sql(`update admin set photo="${NewUrl}" where id="${id}"`, function(qerr,vals,fields){ 
    if(qerr){
        throw qerr
    }else{
        return res.json(vals)
    }
 })
})
module.exports = router;
